using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace Model.Xcode
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [BindTable("DingTalkDepartmentResult", Description = "", ConnName = "DefaultDB", DbType = DatabaseType.SqlServer)]
    public partial class DingTalkDepartmentResult : IDingTalkDepartmentResult
    {
        #region 属性
        private Int32 _Errcode;
        /// <summary></summary>
        [DisplayName("Errcode")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("errcode", "", "int")]
        public Int32 Errcode { get => _Errcode; set { if (OnPropertyChanging(__.Errcode, value)) { _Errcode = value; OnPropertyChanged(__.Errcode); } } }

        private String _Errmsg;
        /// <summary></summary>
        [DisplayName("Errmsg")]
        [DataObjectField(false, false, true, 100)]
        [BindColumn("errmsg", "", "varchar(100)")]
        public String Errmsg { get => _Errmsg; set { if (OnPropertyChanging(__.Errmsg, value)) { _Errmsg = value; OnPropertyChanged(__.Errmsg); } } }

        private String _id;
        /// <summary></summary>
        [DisplayName("id")]
        [DataObjectField(false, false, true, 100)]
        [BindColumn("id", "", "varchar(100)")]
        public String id { get => _id; set { if (OnPropertyChanging(__.id, value)) { _id = value; OnPropertyChanged(__.id); } } }

        private String _DepartmentID;
        /// <summary></summary>
        [DisplayName("DepartmentID")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn("DepartmentID", "", "varchar(50)")]
        public String DepartmentID { get => _DepartmentID; set { if (OnPropertyChanging(__.DepartmentID, value)) { _DepartmentID = value; OnPropertyChanged(__.DepartmentID); } } }

        private DateTime _CreateDate;
        /// <summary></summary>
        [DisplayName("CreateDate")]
        [DataObjectField(false, false, true, 3)]
        [BindColumn("CreateDate", "", "datetime", Precision = 0, Scale = 3)]
        public DateTime CreateDate { get => _CreateDate; set { if (OnPropertyChanging(__.CreateDate, value)) { _CreateDate = value; OnPropertyChanged(__.CreateDate); } } }

        private String _DepartmentName;
        /// <summary></summary>
        [DisplayName("DepartmentName")]
        [DataObjectField(false, false, true, 100)]
        [BindColumn("DepartmentName", "", "varchar(100)")]
        public String DepartmentName { get => _DepartmentName; set { if (OnPropertyChanging(__.DepartmentName, value)) { _DepartmentName = value; OnPropertyChanged(__.DepartmentName); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.Errcode: return _Errcode;
                    case __.Errmsg: return _Errmsg;
                    case __.id: return _id;
                    case __.DepartmentID: return _DepartmentID;
                    case __.CreateDate: return _CreateDate;
                    case __.DepartmentName: return _DepartmentName;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.Errcode: _Errcode = value.ToInt(); break;
                    case __.Errmsg: _Errmsg = Convert.ToString(value); break;
                    case __.id: _id = Convert.ToString(value); break;
                    case __.DepartmentID: _DepartmentID = Convert.ToString(value); break;
                    case __.CreateDate: _CreateDate = value.ToDateTime(); break;
                    case __.DepartmentName: _DepartmentName = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得DingTalkDepartmentResult字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary></summary>
            public static readonly Field Errcode = FindByName(__.Errcode);

            /// <summary></summary>
            public static readonly Field Errmsg = FindByName(__.Errmsg);

            /// <summary></summary>
            public static readonly Field id = FindByName(__.id);

            /// <summary></summary>
            public static readonly Field DepartmentID = FindByName(__.DepartmentID);

            /// <summary></summary>
            public static readonly Field CreateDate = FindByName(__.CreateDate);

            /// <summary></summary>
            public static readonly Field DepartmentName = FindByName(__.DepartmentName);

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得DingTalkDepartmentResult字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary></summary>
            public const String Errcode = "Errcode";

            /// <summary></summary>
            public const String Errmsg = "Errmsg";

            /// <summary></summary>
            public const String id = "id";

            /// <summary></summary>
            public const String DepartmentID = "DepartmentID";

            /// <summary></summary>
            public const String CreateDate = "CreateDate";

            /// <summary></summary>
            public const String DepartmentName = "DepartmentName";
        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface IDingTalkDepartmentResult
    {
        #region 属性
        /// <summary></summary>
        Int32 Errcode { get; set; }

        /// <summary></summary>
        String Errmsg { get; set; }

        /// <summary></summary>
        String id { get; set; }

        /// <summary></summary>
        String DepartmentID { get; set; }

        /// <summary></summary>
        DateTime CreateDate { get; set; }

        /// <summary></summary>
        String DepartmentName { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}